home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 11 / Cream of the Crop 11-2.iso / os2 / rsynth1.zip / dlookup.c < prev    next >
C/C++ Source or Header  |  1994-11-01  |  1KB  |  60 lines

  1. #include <config.h>
  2. #include "proto.h"
  3. #include <stdio.h>
  4. #include <ctype.h>
  5. #include <useconfig.h>
  6. #include "dict.h"
  7. #include "phones.h"
  8. #include "getargs.h"
  9.  
  10. static void show PROTO((char *s));
  11. static void 
  12. show(s)
  13. char *s;
  14. {
  15.  unsigned char *p = dict_find(s, strlen(s));
  16.  printf("%s", s);
  17.  if (p)
  18.   {
  19.    int l = strlen((char *)p);
  20.    int i;
  21.    for (i = 0; i < l; i++)
  22.     printf(" %s", ph_name[(unsigned) (p[i])]);
  23.    printf(" [");
  24.    for (i = 0; i < l; i++)
  25.     printf("%s", dialect[(unsigned) (p[i])]);
  26.    printf("]\n");
  27.    free(p);
  28.   }
  29.  else
  30.   printf(" ???\n");
  31. }
  32.  
  33. int main PROTO((int argc, char *argv[], char *env[]));
  34.  
  35. int
  36. main(argc, argv, envp)
  37. int argc;
  38. char *argv[];
  39. char *envp[];
  40. {
  41.  argc = dict_init(argc, argv);
  42.  if (help_only)
  43.   {
  44.    fprintf(stderr,"Usage: %s [options as above] words to lookup\n",argv[0]);
  45.   }
  46.  else
  47.   {
  48.    if (dict)        
  49.     {               
  50.      int i;
  51.      for (i=1; i < argc; i++)
  52.       {
  53.        show(argv[i]);
  54.       }
  55.      dict_term();   
  56.     }               
  57.   }
  58.  return 0;
  59. }
  60.